<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
        <meta name="msapplication-tap-highlight" content="no" />
        <title>index</title>
        <!--=S assets=-->
        <link rel="stylesheet" type="text/css" href="css/reset.css" />
        <link rel="stylesheet" type="text/css" href="css/main.css" />
        <script type="text/javascript" src="cordova.js"></script>
        <script type="text/javascript" src="js/k/seed-min.js"></script>
        <script type="text/javascript" src="js/global.js"></script>
        <!--=E assets=-->
    </head>
    <body>
        <h1>
            welcome papapa
        </h1>
    <script>
        document.addEventListener('deviceready',function(){
            KISSY.use('dom',function(S,DOM){
//                alert(DOM.get('h1').innerHTML);
//                window.location.href='2.html';

                //自定义颜色
                window.nativeControls.colors.darkred = window.nativeControls.Color(255, 255, 255, 0);

                var navigationBar = window.nativeControls.NavigationBar();
                navigationBar.tintColor = window.nativeControls.Color ( "red" );
                navigationBar.barTintColor = window.nativeControls.Color ( "darkred" );

                navigationBar.addToView();

                var button1 = window.nativeControls.BarTextButton();
                button1.title = "Add"
                var button2 = window.nativeControls.BarTextButton();
                button2.title = "down" ;

                button1.addEventListener ( "tap", function (evt) {

//                    var actionSheet = window.nativeControls.ActionSheet();
//                    actionSheet.title = "Title of sheet";
//                    actionSheet.addButtons ( [ "Delete", "Share", "Cancel" ] );
//                    actionSheet.cancelButtonIndex = 2;
//                    actionSheet.destructiveButtonIndex = 0;
//                    actionSheet.show();

                    alert(navigationBar.frame.origin.x+","+navigationBar.frame.origin.y);
                    alert(navigationBar.frame.size.w+","+navigationBar.frame.size.h);
                    var aRect = window.nativeControls.Rect (0, 0, 200, 200);
                    navigationBar.frame=aRect;
                } );

                var navigationItem = window.nativeControls.NavigationItem();
                navigationItem.title = "index";
                navigationItem.leftButtons = [ button1 ];
                navigationItem.rightButtons = [ button2];
                navigationBar.push (navigationItem);

            });
        }, false);
    </script>
    </body>
</html>
